<%@ page language="java" import="java.util.*,ms.platform.system.model.*"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>数据字典</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="<%=basePath%>js/bootstrap-3.3.6/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/bootstrapValidator.css" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/mydialog.css" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/style.css" />
<script src="<%=basePath %>js/common/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=basePath %>js/rem.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript"src="<%=basePath%>js/common/dialog.3.1.min.js"></script>
<script type="text/javascript" src="<%=basePath %>js/bootstrap-3.3.6/dist/js/bootstrap.min.js" charset="utf-8"></script>
<script type="text/javascript" src="<%=basePath%>js/delete.js"></script>		
	<script type="text/javascript">
		$(document).ready(function(){
			//获取删除字典的ID 添加到隐藏域
			$("span[name='deleteDict']").click(function(){
			       var id=$(this).parent().attr("id");
			       $(".hiddenId").val(id);
				});
			//删除字典
			$("#deleteDict").on("click",function(e){
				var id=$(".hiddenId").val();
				deleteList.hiddenId("<%=path%>/dict/deleteDict","<%=path%>/dict/list",("id="+id));
				
			});
			//清空搜索条件
			$(".clearForm").click(function(){
				$("#queryForm").find("input").val("");
			});
			
			//提交表单
			$(".queryForm").click(function(){
				 var data=$("#queryForm").serialize();
				 window.location.href="<%=path%>/dict/list?"+data;
			});
			
			//跳转到添加页面
			$(".addRole").click(function(){
				window.location.href="<%=path%>/dict/toAddDict";
			});

			//跳转到编辑页面
			$("span[name='editDict']").click(function(){
		       var id=$(this).parent().attr("id");
		       window.location.href="<%=path%>/dict/toEdit?id="+id;
			});
			//跳转到管理页面
			$("span[name='manageDict']").click(function(){
				var id=$(this).parent().attr("id");
				window.location.href="<%=path%>/dict/listData?parentId="+id;
			});
		});

    </script>
</head>
<body>
	<div id="index-hav2">
		<div class="index-hav-right" id="index-hav-right-clear">
			<div class="row">
				<div class="col-md-9">
					<span id="icon-house"></span>
					<span id="arrows-left">首页</span>
					<span id="arrows-left">></span><span>系统管理</span><span id="arrows-left">></span><span>数据字典</span>
				</div>
				<div class="bank-box">
					<div class="lianlian platform">
						<div class="col-md-12">
							<form role="form" id="queryForm">
								<table class="textTable">
									<tr>
										<td class="platform-start">分组名称:</td>
										<th class="">
											<input type="text" class="Wdate form-control input-sm" name="dictName" value="${map['dictName'] }">
										</th>
										<td class="platform-start">分组编码:</td>
										<th class="">
											<input type="text" class="Wdate form-control input-sm" name="dictCode" value="${map['dictCode'] }">
										</th>
										
									</tr>
								</table>
								<ul class="textBtn">
								    <td class="">
										<button type="button" class="queryForm queryFormbtn-sub btn btn-primary btn-sm chaxun">查询</button>
										<button type="button" class="clearForm btn btn-primary btn-sm">重置</button>
										<button type="button" class="addRole btn btn-primary btn-sm">添加分组</button>
									</td>
								</ul>
							</form>

							<table class="control-tatle table table-striped table-bordered table-hover" action="<%=path%>/dict/list">
								<thead class="financing-thead">
									<tr>
										<th >序号</th>
										<th >分组编码</th>
										<th >分组名称</th>
										<th >创建时间</th>
										<th >修改时间</th>
										<th >操作</th>
									</tr>
								</thead>
								<tbody>
								<c:if test="${not empty list}">
									<c:forEach items="${list }" var="dict" varStatus="r">
										<tr>
											<input type="hidden" id ="gro${dict.id }" value="${dict.dictCode }"/>
											<td>${r.index+1 }</td>
											<td>${dict.dictCode }</td>
											<td>${dict.dictName }</td>
											<td><fmt:formatDate value="${dict.createDate }" pattern="yyyy-MM-dd HH:mm:ss" /></td>
											<td><fmt:formatDate value="${dict.updateDate }" pattern="yyyy-MM-dd HH:mm:ss" /></td>
											<td id="${dict.id }">
												<span name="editDict" class="span1">编辑</span>
												<span name="deleteDict" data-toggle='modal' data-target='#bxModal' class="span1">删除</span>
												<span name="manageDict" class="span1">管理</span>
											</td>
											<input type="hidden" class="hiddenId" value="">
										</tr>
									</c:forEach>
									</c:if>
									<c:if test="${empty list}">
										<tr>
											<td colspan="10"><label class="control-label text-center">无记录</label></td>
										</tr>
									</c:if>
								</tbody>
								<tr style="background: #f8f8f8">
									<td colspan="10"><jsp:include flush="false" page="/WEB-INF/jsp/page.jsp"></jsp:include></td>
								</tr>
							</table>
						</div>
						<!-- 删除弹框 start -->
						<div class="modal fade" id="bxModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
						     <div class="modal-dialog modal-tbxb" style=" top:50%; margin-top:-5%;">
						          <div class="modal-content" >
						               <div class="modal-header">
											<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
											<h4 class="modal-title">提示</h4>
									   </div>
									   <div class="modal-body">
									       <div class="form-group financialRisk" style="text-align:center;">
												是否确认删除？
								          </div>
								          <ul class="col-btn-12">
											<li>
												<button class="btn-primary btn" id="deleteDict" data-dismiss="modal" aria-hidden="true">确认</button>
												<button type="button" class="btn-default btn" data-dismiss="modal" aria-hidden="true">取消</button>
											</li>
										</ul>
									   </div>
						          </div>
						     </div>
						</div>
						<!-- 删除弹框 end -->
					</div>
				</div>
			</div>
		</div>
	</div>
	<div id="gray-screen"></div>
</body>
</html>
